package com.sven.idrivingfutureserver.mapper;

import com.sven.idrivingfutureserver.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName UserMapper
 * @Description
 * @Author xiaozhang
 * @Date 2024/5/29 15:34
 * @Version 1.0
 **/
@Mapper
public interface UserMapper {

    void saveUser(UserInfo userInfo);

    void updateLastLogin(UserInfo userInfo);

    void postUserInfo(UserInfo userInfo);

    UserInfo getUserByOpenId(String openId);

    UserInfo getUserById(Integer userId);

    Qrcode getQrcode(String qrcode);

    List<Qrcode> getMyQrcodeList(@Param("userId") int userId);

    void updateQrcodeByQrStr(Qrcode qrcode);

    void savePhoneNumber(PhoneNumber phoneNumber);

    void saveUserSetting(UserSetting setting);

    SettingDetail getMySettingDetail(int userId);

    void saveOptLog(OptLog log);

    void updateMySettingInfo(SettingDetail settingDetail);

    int batchCachingQrcodeList(@Param("qrcodeList") ArrayList<Qrcode> qrcodeList);

    SettingDetail getUserSettingByPlateNumber(String plateNumber);

    // 车牌号相关
    void savePlateNumber(PlateNumber plateNumber);

    void removePLateNumber(@Param("id") Integer id);

    PlateNumber getPlateNumberById(@Param("id") Integer id);

    void updatePlateNumber(PlateNumber plateNumber);

    // 手机号相关
    PhoneNumber getPhoneNumberById(@Param("id") int id);

    ArrayList<PhoneNumber> getPhoneNumberListByUserId(@Param("userId")int userId);

    void updateUserPhoneNumber(PhoneNumber phoneNumber);

    OptLog getOptLogByCodeAndUserId(@Param("code") int code, @Param("userId") int userId);

    List<OptLogDetail> getScanRecords(@Param("userId") int userId);


}
